
class Token:
    tenant_access_token = ''

class Constant:
    #自动测试机器人群的群聊ID
    chat_id_1 = "oc_8294757a8367f385a0fcb13ddcbfe184"
    #用于复现的网网址
    trace_url = "https://trace.playwright.dev/"

class Card(object):
    def __init__(self, result,proj_name):
        self.result = result
        self.proj_name = proj_name
        self.card_result ={
                    "config": {
                        "update_multi": True
                    },
                    "i18n_elements": {
                        "zh_cn": [
                            {
                                "tag": "column_set",
                                "flex_mode": "none",
                                "horizontal_spacing": "default",
                                "background_style": "default",
                                "columns": [
                                    {
                                        "tag": "column",
                                        "elements": [
                                            {
                                                "tag": "div",
                                                "text": {
                                                    "tag": "plain_text",
                                                    "content": "${"  +  self.result +  "}",
                                                    "text_size": "normal",
                                                    "text_align": "left",
                                                    "text_color": "default"
                                                }
                                            }
                                        ],
                                        "width": "weighted",
                                        "weight": 1
                                    }
                                ]
                            },
                            {
                                "tag": "hr"
                            },
                            {
                                "tag": "column_set",
                                "flex_mode": "none",
                                "horizontal_spacing": "default",
                                "background_style": "default",
                                "columns": [
                                    {
                                        "tag": "column",
                                        "elements": [
                                            {
                                                "tag": "div",
                                                "text": {
                                                    "tag": "plain_text",
                                                    "content": "控制台输出",
                                                    "text_size": "heading",
                                                    "text_align": "left",
                                                    "text_color": "default"
                                                },
                                                "icon": {
                                                    "tag": "standard_icon",
                                                    "token": "video_outlined",
                                                    "color": "grey"
                                                }
                                            }
                                        ],
                                        "width": "weighted",
                                        "weight": 1
                                    }
                                ]
                            },
                            {
                                "tag": "column_set",
                                "flex_mode": "none",
                                "horizontal_spacing": "default",
                                "background_style": "default",
                                "columns": [
                                    {
                                        "tag": "column",
                                        "elements": [
                                            {
                                                "tag": "div",
                                                "text": {
                                                    "tag": "plain_text",
                                                    "content": "${"+self.proj_name+"}",
                                                    "text_size": "notation",
                                                    "text_align": "left",
                                                    "text_color": "default"
                                                }
                                            }
                                        ],
                                        "width": "weighted",
                                        "weight": 1
                                    }
                                ]
                            },
                            {
                                "tag": "action",
                                "layout": "default",
                                "actions": [
                                    {
                                        "tag": "button",
                                        "text": {
                                            "tag": "plain_text",
                                            "content": "查看日志"
                                        },
                                        "type": "default",
                                        "width": "default",
                                        "size": "medium"
                                    },
                                    {
                                        "tag": "button",
                                        "text": {
                                            "tag": "plain_text",
                                            "content": "复现视频"
                                        },
                                        "type": "default",
                                        "width": "default",
                                        "size": "medium"
                                    }
                                ]
                            }
                        ]
                    },
                    "i18n_header": {
                        "zh_cn": {
                            "title": {
                                "tag": "plain_text",
                                "content": "测试结果"
                            },
                            "subtitle": {
                                "tag": "plain_text",
                                "content": "${proj_name}:"
                            },
                            "ud_icon": {
                                "tag": "standard_icon",
                                "token": "robot_outlined"
                            }
                        }
                    }
                }
